<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>erp进销存系统</title>
	<link rel="stylesheet" href="../../static/css/style.css" th:href="@{http://localhost:8080/css/style.css}">
	<link rel="stylesheet" href="../../static/css/man/manager_list.css"
		  th:href="@{http://localhost:8080/css/man/manager_list.css}">
	<link rel="stylesheet" href="../../static/layui/css/layui.css"
		  th:href="@{http://localhost:8080/layui/css/layui.css}">
	<script src="../../static/layui/layui.js" th:src="@{http://localhost:8080/layui/layui.js}"></script>
	<script src="../../static/js/jquery.js"
			th:src="@{http://localhost:8080/webjars/jquery/3.6.0/jquery.min.js}"></script>
	<script src="../../static/js/man/manager.js" th:src="@{http://localhost:8080/js/man/manager.js}" ></script>

</head>
<body>
	<h1>用户添加</h1>
	<div class="layui-container" style=" width: 800px; margin:0 0 0 200px;">
		<form class="layui-form" action="/manager/save" method="post">
			<div class="layui-form-item">
				<div class="layui-form-label layui-form-danger">真实姓名</div>
				<div class="layui-input-inline" style="width: 400px;">
					<input type="text" name="realName" required  lay-verify="required" placeholder="请输入真实姓名" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-form-label layui-form-danger">用户名</div>
				<div class="layui-input-inline">
					<input type="text" name="userName" style="width: 400px;" id="ipt_user_name" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
				</div>
				<div class="layui-form-label layui-form-danger" id="user_name" style="width: 300px;  margin:0 0 0 100px;color:red;"></div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<input type="password" required lay-verify="required"  style="width: 400px;" placeholder="请输入密码" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<input type="password" name="password" required lay-verify="required"  style="width: 400px;" placeholder="请重新输入密码" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<input type="text" name="telephone" required  lay-verify="required"  style="width: 400px;" placeholder="请输入手机号" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-input-block">是否拥有管理员权限</label>
				<div class="layui-input-block">
					<input type="checkbox" name="role" lay-skin="switch" value="0">
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				</div>
			</div>
		</form>
	</div>

	<script>
		//Demo
		layui.use('form', function(){
			var form = layui.form;

			//监听提交
			form.on('submit(formDemo)', function(data){

				// layer.msg(JSON.stringify(data.field));
				// console.log(JSON.stringify(data.field));
				// var man = data.field;
				// $.ajax({
				// 	url:"/manager/save",
				// 	type:"post",
				// 	data:"{userName:"+man.user_name+",realName:"+man.real_name+",password:"+man.password+",telephone:"+man.telephone+",role:"+man.role+"}",
				// 	success:function (data){
				// 		console.log(data);
				// 	}
				// })
				// return false;
			});
		});
	</script>

</body>
</html>

